package models

import (
	"github.com/astaxie/beego/orm"
)

/*
** 参考文献信息
 */
type DBInfo struct {
	Id               int64
	LigandsCount     int64
	IndicationsConut int64
	TargetsConut     int64
	PositonsConut    int64
	RelationsConut   int64
	ReferencesConut  int64
	SDFile           string
}

func (m *DBInfo) TableName() string {
	return "dbinfo"
}

func (m *DBInfo) Insert() error {
	if _, err := orm.NewOrm().Insert(m); err != nil {
		return err
	}
	return nil
}

func (m *DBInfo) Read(fields ...string) error {
	if err := orm.NewOrm().Read(m, fields...); err != nil {
		return err
	}
	return nil
}

func (m *DBInfo) Update(fields ...string) error {
	if _, err := orm.NewOrm().Update(m, fields...); err != nil {
		return err
	}
	return nil
}

func (m *DBInfo) Delete() error {
	if _, err := orm.NewOrm().Delete(m); err != nil {
		return err
	}
	return nil
}

func (m *DBInfo) Query() orm.QuerySeter {
	return orm.NewOrm().QueryTable(m)
}
